package cn.bb.pojo;


import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "t_person")
public class Person implements Serializable {
    private int id;
    private String username;
    private String userpassword;
    private int age;

    public Person() {

    }

    public Person(int id, String username, String userpassword, int age) {
        this.id = id;
        this.username = username;
        this.userpassword = userpassword;
        this.age = age;
    }

    public Person(String username, String userpassword, int age) {
        this.username = username;
        this.userpassword = userpassword;
        this.age = age;
    }
    @Id
    @GeneratedValue
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    @Column(name = "userpassword")
    public String getUserpassword() {
        return userpassword;
    }

    public void setUserpassword(String userpassword) {
        this.userpassword = userpassword;
    }
    @Column(name = "age")
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", userpassword='" + userpassword + '\'' +
                ", age=" + age +
                '}';
    }
}
